package com.oolatina.activity;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Display;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;

import com.oolatina.R;
import com.oolatina.R.id;
import com.oolatina.R.layout;
import com.oolatina.SCYoutubeView;

public class YoutubeView extends Activity {

	int ScreenWidth;
	int ScreenHeight;
	FrameLayout linearLayout;
	private String videoID;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
	    super.onCreate(savedInstanceState);
	
	    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

        //Remove notification bar
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);
        
        WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
	    Display display = wm.getDefaultDisplay();
	    ScreenWidth = display.getWidth();
	    ScreenHeight = display.getHeight();        
        
        linearLayout = (FrameLayout)findViewById(R.id.fragment_content);
	    
        Bundle extras = getIntent().getExtras();
        if(extras!=null){
        	videoID = extras.getString("VIDEOID");
        }
        
        
	    SCYoutubeView ytview = new SCYoutubeView();
        ytview.init(linearLayout, this);
        ytview.setSizePourcent(100, 35);
        ytview.SetPosition(0, 60);
        ytview.setId(videoID);
	}

}
